package com.xiaohai.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xiaohai.projo.Student;
import com.xiaohai.projo.Teacher;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author xiaohai
 * @since 2024-01-22
 */
@Transactional
public interface TeacherService extends IService<Teacher> {
    /**
     * 修改信息
     * @param student
     * @return
     */

    boolean updateInfo(Student student);

    boolean updatePasswordByAccount(String account, String newPassword);

    Page<Teacher> myList(Integer currentPage, Integer pageSize, Teacher teacher);

    boolean add(Teacher teacher);

    Teacher detail(String id);

    Boolean myUpdate(Teacher teacher);

    /**
     * 根据教师id查询该教师是否是班主任或者手低上有学生，如果有则删除失败
     * @param id
     * @return
     */
    boolean delete(Integer id);

    /**
     * 根据教师名字获取id
     *
     * @param teacherName
     * @return
     */

    Integer[] getIdsByName(String teacherName);

    /**
     * 根据教师账户获取教师信息
     *
     * @param account
     * @return
     */

    Teacher getInfoByAccount(String account);
}
